package cn.tonystack.test;

import cn.tonystack.domain.res.ResponseData;
import cn.tonystack.service.weixin.IWeixinMapService;
import com.alibaba.fastjson2.JSON;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import retrofit2.Call;

import javax.annotation.Resource;
import java.io.IOException;

/**
 * @description：TODO
 * @author： tony.pan
 * @create： 2024/10/10 21:08
 */
@RunWith(SpringRunner.class)
@SpringBootTest
public class MapApiTest {

    @Resource
    private IWeixinMapService weixinMapService;

    @Test
    public void map_Test() throws IOException {
        Call<ResponseData> call = weixinMapService.getAddress("30.555605,114.206871", "O4DBZ-OXQEG-7HGQV-Q4XJC-XFYQF-UYBZ4", 0);
        ResponseData body = call.execute().body();
        System.out.println(JSON.toJSONString(body.getResult().getAddress()));
    }

}
